package com.wd.amodel.util;

import java.util.TreeMap;

/**
 * 情感化工具类<BR>
 *
 * @author wangming
 * @version [V5.9.2, 2021/4/28]
 * @since V5.9.2
 */
public final class EmotionModelUtils {

    /**
     * 正常模式
     */
    private static final TreeMap<Integer, String> defaultColor = new TreeMap<>();

    /**
     * 情感模式
     */
    private static final TreeMap<Integer, String> emotionColor = new TreeMap<>();

    /**
     * 暗黑模式
     */
    private static final TreeMap<Integer, String> darkColor = new TreeMap<>();

    static {
        // 正常模式颜色字典
        defaultColor.put(ColorConstant.ORDER_VALUE_ONE, "#333333");
        defaultColor.put(ColorConstant.ORDER_VALUE_TWO, "#666666");
        defaultColor.put(ColorConstant.ORDER_VALUE_THREE, "#808080");
        defaultColor.put(ColorConstant.ORDER_VALUE_FOUR, "#999999");
        defaultColor.put(ColorConstant.ORDER_VALUE_FIVE, "#B3B3B3");
        defaultColor.put(ColorConstant.ORDER_VALUE_SIX, "#CCCCCC");
        defaultColor.put(ColorConstant.ORDER_VALUE_SEVEN, "#E8E8E8");
        defaultColor.put(ColorConstant.ORDER_VALUE_EIGHT, "#F8F8F8");
        defaultColor.put(ColorConstant.ORDER_VALUE_NINE, "#F8F8F8");
        defaultColor.put(ColorConstant.ORDER_VALUE_TEN, "#FFFFFF");
        defaultColor.put(ColorConstant.ORDER_VALUE_ELEVEN, "#FFFFFF");
        defaultColor.put(ColorConstant.ORDER_VALUE_TWELVE, "#F8F8F8");
        defaultColor.put(ColorConstant.ORDER_VALUE_TTHIRTEEN, "#E8E8E8");
        defaultColor.put(ColorConstant.ORDER_VALUE_THIRTEEN, "#E8EFF4");
        defaultColor.put(ColorConstant.ORDER_VALUE_FIFTEEN, "#E8EFF4");

        // 情感模式颜色字典
        emotionColor.put(ColorConstant.ORDER_VALUE_ONE, "#FFFFFF");
        emotionColor.put(ColorConstant.ORDER_VALUE_TWO, "#CCFFFFFF");
        emotionColor.put(ColorConstant.ORDER_VALUE_THREE, "#B3FFFFFF");
        emotionColor.put(ColorConstant.ORDER_VALUE_FOUR, "#99FFFFFF");
        emotionColor.put(ColorConstant.ORDER_VALUE_FIVE, "#66FFFFFF");
        emotionColor.put(ColorConstant.ORDER_VALUE_SIX, "#4DFFFFFF");
        emotionColor.put(ColorConstant.ORDER_VALUE_SEVEN, "#33FFFFFF");
        emotionColor.put(ColorConstant.ORDER_VALUE_EIGHT, "#0DFFFFFF");
        emotionColor.put(ColorConstant.ORDER_VALUE_NINE, "#26000000");
        emotionColor.put(ColorConstant.ORDER_VALUE_TEN, "#1AFFFFFF");
        emotionColor.put(ColorConstant.ORDER_VALUE_ELEVEN, "#66FFFFFF");
        emotionColor.put(ColorConstant.ORDER_VALUE_TWELVE, "#4D000000");
        emotionColor.put(ColorConstant.ORDER_VALUE_TTHIRTEEN, "#4D000000");
        emotionColor.put(ColorConstant.ORDER_VALUE_THIRTEEN, "#4DFFFFFF");
        emotionColor.put(ColorConstant.ORDER_VALUE_FIFTEEN, "#0DFFFFFF");

        // 暗黑模式颜色字典
        darkColor.put(ColorConstant.ORDER_VALUE_ONE, "#333333");
        darkColor.put(ColorConstant.ORDER_VALUE_TWO, "#666666");
        darkColor.put(ColorConstant.ORDER_VALUE_THREE, "#808080");
        darkColor.put(ColorConstant.ORDER_VALUE_FOUR, "#999999");
        darkColor.put(ColorConstant.ORDER_VALUE_FIVE, "#B3B3B3");
        darkColor.put(ColorConstant.ORDER_VALUE_SIX, "#CCCCCC");
        darkColor.put(ColorConstant.ORDER_VALUE_SEVEN, "#E8E8E8");
        darkColor.put(ColorConstant.ORDER_VALUE_EIGHT, "#F8F8F8");
        darkColor.put(ColorConstant.ORDER_VALUE_NINE, "#F8F8F8");
        darkColor.put(ColorConstant.ORDER_VALUE_TEN, "#FFFFFF");
        darkColor.put(ColorConstant.ORDER_VALUE_ELEVEN, "#FFFFFF");
        darkColor.put(ColorConstant.ORDER_VALUE_TWELVE, "#F8F8F8");
        darkColor.put(ColorConstant.ORDER_VALUE_TTHIRTEEN, "#E8E8E8");
        darkColor.put(ColorConstant.ORDER_VALUE_THIRTEEN, "#E8EFF4");
        darkColor.put(ColorConstant.ORDER_VALUE_FIFTEEN, "#E8EFF4");
    }

    /**
     * 获取颜色值 [情感化>暗黑>正常]
     *
     * @param numberColor 颜色序号
     * @return 颜色值
     */
    public static String getColorValue(int numberColor) {
        if (isEmotionModel()) {
            return emotionColor.get(numberColor);
        }
        if (isSupportDarkModel()) {
            return darkColor.get(numberColor);
        }
        return defaultColor.get(numberColor);
    }

    /**
     * 是否是情感模式
     *
     * @return true 是 false 不是
     */
    public static boolean isEmotionModel() {
        return true;
    }

    /**
     * 是否支持暗黑模式
     *
     * @return true 支持 false 不支持
     */
    public static boolean isSupportDarkModel() {
        return false;
    }
}
